using System;
using System.Web;
using System.Web.UI;

namespace Sedna.Core.Controller.Configurations
{
	public class HttpEncodeDataTranslator : IDataTranslator
	{
		public object Translate(Control control, object value)
		{
			return Translate(control, value, null);
		}

		public object Translate(Control control, object value, Type targetType)
		{
			return value==null?null:HttpUtility.HtmlEncode(value.ToString());
		}

	}
}
